<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/wesite/view/common/base.jsp"%>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>订单明细</title>
    <%@ include file="/wesite/view/common/common.jsp"%>
    <script src="${webctx }/script/orderdetail.js"></script>
    <style>
        .mark-badge {
            height: 0.693333rem;
            display: inline-block;
            font-size: 0.4rem;
            line-height: 0.693333rem;
            padding: 0 0.2rem;
            box-sizing: border-box;
            border: 1px solid red;
            color: red;
            margin-right: 0.2rem;
        }
    </style>
</head>
<body>
    <div class="sure-order">
        <div class="serial-number">
            <span class="num">订单号：${order.code }</span>
            <span class="state">${order.statustxt}</span>
        </div>
        <div class="sure-order-info">     
            <div class="top">
                <p class="name fl"><i class="ico"></i><span>${order.receipt_user }</span></p>
                <p class="phone fr"><i class="ico"></i><span>${order.receipt_phone }</span></p>
            </div>
            <div class="cl"></div>
            <div class="addr">
                <i class="ico"></i>
                <div class="con fl">
                    <p>${order.receipt_shen } ${order.receipt_shi } ${order.receipt_qu }</p>
                    <p> ${order.receipt_address }</p>
                </div>
            </div>
        </div>
        <div class="mark-info">
            <span>备注：${order.bz }</span>
        </div>
        <div class="shopping-cart mt20">
            <div class="order-product-list">
                <ul>
                    <c:forEach items="${products }" var="product" varStatus="status">
                    <li>
                        <a href="${ctx }/we/product/${product.id }" ><img src="<%=getRandomFileserver()%>${product.photo}" onerror="this.src='${ctx }/wesite/images/noimg.jpg'"  alt=""></a>
                        <div class="rg">
                            <h3>
                            <c:if test="${product.gift==1}">
                                <span class="mark-badge">赠品</span>
                            </c:if>
                            ${product.productname } ${product.name }
                            </h3>
                            <p><span class="amount">数量：${product.buyamount }</span><span class="price">¥${product.sumprice }</span></p>
                        </div>
                    </li>
                    </c:forEach>
                </ul>
            </div>
            <div class="order-other-info">
                <ul>
                    <li>
                        <span class="tit fl">配送方式：</span>
                        <input class="fr" type="text" value="物流配送" readonly="">
                    </li>
                    <li>
                        <span class="tit fl">支付方式：</span>
                        <c:choose>
                            <c:when test="${order.paytype == 1}">
                                <c:if test="${order.pay_way == '' || order.pay_way == null }">
                                    <input class="fr" type="text" value="在线支付" readonly="">
                                </c:if>
                                <c:if test="${order.pay_way == 'WECHAT_QR' || order.pay_way == 'WECHAT_MP' }">
                                    <input class="fr" type="text" value="微信支付" readonly="">
                                </c:if>
                            </c:when>
                            <c:when test="${order.paytype == 2}">
                                <input class="fr" type="text" value="货到付款" readonly="">
                            </c:when>
                        </c:choose>
                    </li>
                    <li>
                        <span class="tit fl">发票信息：</span>
                        <input class="fr" type="text" value="" readonly="">
                        <span class="arrow-r"></span>
                    </li>
                </ul>
            </div>
            <div class="summary mt20">
                <p><label>商品总额</label><span class="fr">${order.order_money }</span></p>
                <%--<p><label>运费</label><span class="fr">-¥${order.fare_money }</span></p>--%>
                <p><label>促销优惠：</label><span class="fr">-¥${order.reduce_money }</span></p>
                <p><label>优惠券抵扣：</label><span class="fr">-¥${order.yh_money }</span></p>
            </div>
            <div class="order-detail-date">
                <span class="fl">下单时间:${order.ordertime}</span>
                <span class="fr">实付款：<i>¥${order.pay_money }</i></span>
            </div>
        </div>
       </div>
    </div>

    <c:choose>
        <c:when test="${order.status==1}">
            <div class="h98"></div>
            <div class="order-detail-bottom">
                <div class="operate">
                    <span><a class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm" href="javascript:cancelorder('${order.code }');">取消订单</a></span>
                    <span><a class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm" href="${ctx}/we/pay/way?orderType=PRODUCT_ORDER&orderSn=${order.code}">去支付</a></span>
                </div>
            </div>
        </c:when>
        <c:when test="${order.status==2 || (order.status==3 && order.issyn<=0)}">
            <div class="h98"></div>
            <div class="order-detail-bottom">
                <div class="operate">
                    <span><a class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm" href="javascript:cancelorder('${order.code }');">取消订单</a></span>
                </div>
            </div>
        </c:when>
        <c:when test="${order.status==7}">
            <div class="h98"></div>
            <div class="order-detail-bottom">
                <div class="operate">
                    <span ><a class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm" href="javascript:;" onclick="shouhuo('${order.code }',this)">确定收货</a></span>
                </div>
            </div>
        </c:when>
        <c:when test="${order.status==9 || order.status==11}">
            <div class="h98"></div>
            <div class="order-detail-bottom">
                <div class="operate">
                    <span><a class="aui-btn aui-btn-danger aui-btn-block aui-btn-outlined aui-btn-sm" href="javascript:buyagain('${order.code }');">再次购买</a></span>
                </div>
            </div>
        </c:when>
    </c:choose>
</body>
</html>
</script>